handling memory warning and image unavailable scenario.