improve image serving performance slightly
check attributes before saving over image file