Modified to manage warnings in images