Handles multiple image extensions