Fixed issue where empty images would cause a break