Remove duplicate code for parsing image name