Instagram uses an MD5 hash as the base name , followed by an underscore and a number representing the size of the image. Please note that they probably do not just use the contents of the file in their hash, since loading the same image can create a file name conflict, so they will probably add some entropy to their calculations.
source share