php will work for sorting the resolutions, but no idea about detecting the error code give by windows to detect the corrupt images, and any sorting crashes windows first due to bad ones. thanks, sorry for being rude this thing is aggrivating me