Changed padding constant, as it leads to problems with float images. Use image min/max, which were being computed anyway
Updated deprecated timing calls