use more specific check if image really exists in the database