Added fail safes to the Images class